import os


class Config:
    SECRET_KEY = 'secret key hello !'
    SQLALCHEMY_DATABASE_URI = f'mysql+pymysql://{os.environ.get("DB_USERNAME")}:{os.environ.get("DB_PWD")}@{os.environ.get("DB_HOST")}:{os.environ.get("DB_PORT")}/{os.environ.get("DB_NAME")}?{os.environ.get("DB_CHARSET")}'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    # 邮箱配置
    MAIL_SERVER = 'smtp.qq.com'
    MAIL_PORT = 465
    MAIL_USE_TLS = False
    MAIL_USE_SSL = True
    MAIL_PASSWORD = 'dopswigbwgfebcea'
    MAIL_USERNAME = '1032162439@qq.com'


class DevConfig(Config):
    DEBUG = True


class ProductConfig(Config):
    DEBUG = False


config_dict = {
    "default": DevConfig(),
    "dev": DevConfig(),
    "product": ProductConfig()
}
